home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Programming / LEDA / prog / graph / bicomp.c < prev    next >
C/C++ Source or Header  |  1994-08-05  |  520b  |  36 lines

  1. #include <LEDA/graph.h>
  2. #include <LEDA/ugraph.h>
  3. #include <LEDA/graph_alg.h>
  4.  
  5.  
  6. main()
  7. {
  8.  
  9. UGRAPH<int,int> G;
  10.  
  11. test_ugraph(G);
  12.  
  13. edge_array<int> compnum(G);
  14.  
  15. float T = used_time();
  16. cout << "BI_COMPONENTS   ";
  17. cout.flush();
  18. int n = BICONNECTED_COMPONENTS(G,compnum);
  19. cout << string("   %6.2f sec \n",used_time(T));
  20. newline;
  21.  
  22. cout << n << " components\n";
  23. newline;
  24.  
  25. if (Yes("ausgabe?")) 
  26.  { edge e;
  27.    forall_edges(e,G) 
  28.    { G.print_edge(e);
  29.      cout << string("  c = %3d  \n", compnum[e]);
  30.     }
  31.   }
  32. newline;
  33.  
  34. return 0;
  35. }
  36.